package tag39_03_09.threadsWeiter;


public class Th18_threadsicher {

	public static void main(String[] args) {

//		StringBuilder sb = new StringBuilder();
		StringBuffer sb = new StringBuffer();
		
		new Thread(){
			public void run() {
				for (int i = 0; i < 10000; ) {
					sb.append(i);
//					try { sleep(200); } catch(InterruptedException e) { e.printStackTrace();}
				}
			}
		}.start();

		new Thread(){
			public void run() {
				for (int i = 0; i < 10000; ) {
//					int index = sb.length()-1;
					System.out.println(sb);
//					try { sleep(200); } catch(InterruptedException e) { e.printStackTrace();}
//					sb.deleteCharAt(0);
				}
			}
		}.start();
		
	}

}
